//
//  QCustomAnnotationView.m
//  QMCXDriver
//
//  Created by Massimo on 2017/4/18.
//  Copyright © 2017年 Massimo. All rights reserved.
//

#import "QCustomAnnotationView.h"
#import "CustomCalloutView.h"

#define calloutWidth 200
#define calloutHeight 90

@interface QCustomAnnotationView()

@property (nonatomic, strong) CustomCalloutView *customCalloutView;

@end


@implementation QCustomAnnotationView

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/
- (void)showCallOutView{
    if (_customCalloutView == nil) {
        _customCalloutView = [[CustomCalloutView alloc]
                              initWithFrame:CGRectMake(0,
                                                       0,
                                                       200,
                                                       90)];
//        _customCalloutView.center =
//        CGPointMake(CGRectGetWidth(self.bounds) / 2,
//                    -CGRectGetHeight(self.customCalloutView.bounds)/2);
        [_customCalloutView setTitle:@"ddddddd"];
        [_customCalloutView setSubtitle:@"bbbbbbbbb"];
        
    }
    [self addSubview:_customCalloutView];
}
-(void)dismissCallOutView{
    [_customCalloutView removeFromSuperview];
}
- (void)setSelected:(BOOL)selected{
    [self setSelected:selected animated:NO];
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated{
    [super setSelected:selected animated:animated];
}
@end
